﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Entity;

using SosForms;
using SosData;

namespace UOCmaker
{
    public partial class FormTablaGrupo : FormBase
    {

        #region " Constructores "

        /// <summary>
        /// constructor
        /// </summary>
        public FormTablaGrupo()
        {
            InitializeComponent();
        }

        sosContext db = null;

        private void FrmTablaGrupo_Load(object sender, EventArgs e)
        {
            db = new sosContext();
            db.GruposPlantilla.Load();
            bindingSource.DataSource = db.GruposPlantilla.Local.ToBindingList();

            romGridView.DataSource = bindingSource;
        }

        #endregion

        #region " Metodos "

        /// <summary>
        /// aceptar cambios
        /// </summary>
        private void Aceptar()
        {
            db.SaveChanges();
            this.Close();
        }

        #endregion

        #region " Controles "

        private void butCancelar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void butAceptar_Click(object sender, EventArgs e)
        {
            this.Aceptar();
        }

        #endregion

    }
}
